package com.sl.plugin.step.selenium.delay;

import com.sl.core.engine.meta.impl.AbstractProcessCompDescriptor;
import com.sl.core.engine.step.ProcessCompService;
import com.sl.core.engine.step.impl.AbstractProcessComp;
import org.openqa.selenium.WebDriver;

import java.util.concurrent.TimeUnit;

/**
 */
public class SeleniumDelayComp extends AbstractProcessComp<WebDriver, WebDriver> implements ProcessCompService {


    public SeleniumDelayComp(AbstractProcessCompDescriptor abstractProcessCompDescriptor) {
        super(abstractProcessCompDescriptor);
    }

    @Override
    public WebDriver input(WebDriver driver) {
        Integer time = meta.getIntAttr("time");
        driver.manage().timeouts().implicitlyWait(time, TimeUnit.MILLISECONDS);
        return driver;
    }


}
